﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

#if !SILVERLIGHT
namespace UIT.WPF.Renderers
#else
namespace UIT.Silverlight.Renderers
#endif
{
    public class PageRenderer : WpfRenderer<Controls.Containers.Page, Window>
    {
        public override void Render(Controls.Containers.Page control)
        {
            Result = new Window();
            Result.DataContext = control;
            Result.SetBinding(Window.TitleProperty, "Title");

            foreach (var item in control.Children)
            {
                var childUI = Manager.Render(item);
                if (childUI != null)
                {
                    Result.Content = childUI;
                }
            }
        }
    }
}
